from django.contrib import admin

from helloWorld.models import BookTypeInfo, BookInfo

# Register your models here.
# 方法一，将模型直接注册到admin后台
admin.site.register(BookTypeInfo)


# 自定义类，继承ModelAdmin
@admin.register(BookInfo)
class BookInfoAdmin(admin.ModelAdmin):
    # 设置显示的字段
    list_display = ['id', 'bookName', 'publishDate', 'bookType']
    search_fields = ['bookName', 'publishDate']


# 设置网站标题和应用标题
admin.site.site_title = '锋哥后台管理'
admin.site.index_title = '图书管理模块'
admin.site.site_header = 'python222网站管理系统'
